<?php $start = false; $classFunc="funcionarios"; ?>
<div>
    <div>
        <form id="buscaUsers" action="<?= $this->form->getAction() ?>" method="post">

            <? foreach ($this->form as $element): ?>
                <?php
                    if ($element->getid()== "tipo_pessoa" && $element->getValue() == 2):
                          $classFunc = "";  
                    endif;
                ?>

                <?php if (!is_null($element->getAttrib("class")) && $element->getAttrib("class") == "funcionario" && !$start): ?>
                    <?php $start = true; ?>
                    <div id="funcionarios" class="<?= $classFunc ?>">
                    <?php endif; ?>
                    <?php if (is_null($element->getAttrib("class")) && $start): ?>        
                    <?php $start = false; ?>
                    </div>
                <?php endif; ?>

                <?= $element ?>
            <? endforeach ?>

            <input  type="submit" id="btnEnviar" value="Salvar" class="btn-large"/>
        </form>
    </div>
</div>
